package com.fallsvc.order.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.loadbalancer.annotation.LoadBalancerClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @auther falls_vc
 * description:
 * @date 2025/5/25  22:08
 */

/**
 * 自定义负载均衡配置
 */
//@LoadBalancerClient()
//    name :服务名称
//    configuration : 自定义配置
// @LoadBalancerClients 多个
@LoadBalancerClient(name = "product-service",configuration = CustomLoadBalancerConfiguration.class)
@Configuration
public class BeanConfig {

    @Bean
    @LoadBalanced
    public RestTemplate getRestTemplate() {
        return new RestTemplate();
    }
}
